home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / CMUrl.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.2 KB  |  77 lines

  1. /* Very cute: a Popobject with CManager */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call Init
  7. call CreateApp
  8. call HandleApp
  9. /* never reached */
  10. /***********************************************************************/
  11. Init: procedure
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  14.     call RxMUIOpt("DebugMode ShowErr")
  15.     call SetRxMUIStack(64000) /* CManager uses NList ! */
  16.     return
  17. /***********************************************************************/
  18. CreateApp: procedure
  19.  
  20.     app.Title="Choose an URL"
  21.     app.Version="$VER: ChooseURL 2.1 (25.1.2002)"
  22.     app.Copyright="Copyright © 2002 by Alfonso Ranieri"
  23.     app.Author="Alfonso Ranieri"
  24.     app.Description="Let you choose an URL"
  25.     app.Base="CURL"
  26.     app.SubWindow="win"
  27.      win.Title="Choose an URL"
  28.      win.Contents="mgroup"
  29.      win.ID="MAIN"
  30.       mgroup.0="pg"
  31.        pg.Class="Group"
  32.        pg.Horiz=1
  33.         pg.0=Label("_URL")
  34.         pg.1="pop"
  35.          pop.Class="Popobject"
  36.          pop.Toggle=1
  37.          pop.String=String("url",'u')
  38.          pop.Button=MakeObj(,"ImageButton","Popup")
  39.          pop.Object="cm"
  40.           cm.Class="cm"
  41.           cm.Frame="InputList"
  42.           cm.HideUsers=1
  43.           cm.HideWWW=0
  44.           cm.HideFtp=1
  45.           cm.HideChat=1
  46.           cm.HideTelnet=1
  47.           cm.DoubleClick="cmentry"
  48.          pop.CloseFun="call set('url','contents',RxMUIGetVar('cmentry.www'))"
  49.  
  50.     if NewObj("Application","app")>0 then exit
  51.  
  52.     call DoMethod("cm","LoadData")
  53.  
  54.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  55.     call Notify("cm","DoubleClick","EveryTime","pop","Close",1)
  56.  
  57.     call set("win","open",1)
  58.  
  59.     return
  60. /***********************************************************************/
  61. HandleApp: procedure
  62.     do forever
  63.         call NewHandle("APP","H",2**12)
  64.         if and(h.signals,2**12)>0 then exit
  65.         select
  66.             when h.event="QUIT" then exit
  67.             when h.event="POP" then call set("url","contents",cmentry.www)
  68.             otherwise nop
  69.         end
  70.     end
  71.     /* never reached */
  72. /***********************************************************************/
  73. halt:
  74. break_c:
  75.     exit
  76. /**************************************************************************/
  77.